nums = [1,1,1,2,2,3]
var removeDuplicates = function(nums) {
    left = 2
    for(let i=2;i<nums.length;i++){
        if(nums[i]==nums[i-1]&&nums[i]==nums[i-2]){
            nums.splice(i,1)
            i--
        }
    }
    return nums.length
};
console.log(removeDuplicates(nums));
